<?php
// 本类由系统自动生成，仅供测试用途
class DownAction extends Action {
    public function index(){
		R('Index/indexpic');
		$this->index_new();
		$this->index_xjgl();
		$this->index_ksgl();
		$this->index_qt();
        $this->display();
    }

	public function xjgl(){
		R('Index/indexpic');
		$file=M('file');
		import("ORG.Util.Page");//导入分页类
		$cond['type']='学籍管理';
		$index=$file->where($cond)->count();
		$Page = new Page($index,10);//实例化分页类传入总记录数和每页显示的记录数
		$show = $Page->show();//分页显示输出
		//进行分页数据查询注意limit方法的参数要使用Page类的属性
		$list = $file->where($cond)->order('id DESC')->limit($Page->firstRow.','.$Page->listRows)->select();

		for($i=0;$i<count($list);$i++){
			$list[$i]['uptime'] = 	date("Y-m-d H:i",$list[$i]['uptime']);
		}
		$this->assign('xjgl',$list);
		$this->assign('page',$show);//赋值分页输出
		$this->display();
	}

	public function ksgl(){
		R('Index/indexpic');
		$file=M('file');
		import("ORG.Util.Page");//导入分页类
		$cond['type']='考试及成绩管理';
		$index=$file->where($cond)->count();

		$Page = new Page($index,10);//实例化分页类传入总记录数和每页显示的记录数
		$show = $Page->show();//分页显示输出
		//进行分页数据查询注意limit方法的参数要使用Page类的属性
		$list = $file->where($cond)->order('id DESC')->limit($Page->firstRow.','.$Page->listRows)->select();

		for($i=0;$i<count($list);$i++){
			$list[$i]['uptime'] = 	date("Y-m-d H:i",$list[$i]['uptime']);
		}
		$this->assign('ksgl',$list);
		$this->assign('page',$show);//赋值分页输出
		$this->display();
    }

	public function other(){
		R('Index/indexpic');
		$file=M('file');
		import("ORG.Util.Page");//导入分页类
		$cond['type']='其他';
		$index=$file->where($cond)->count();
		$Page = new Page($index,10);//实例化分页类传入总记录数和每页显示的记录数
		$show = $Page->show();//分页显示输出
		//进行分页数据查询注意limit方法的参数要使用Page类的属性
		$list = $file->where($cond)->order('id DESC')->limit($Page->firstRow.','.$Page->listRows)->select();

		for($i=0;$i<count($list);$i++){
			$list[$i]['uptime'] = 	date("Y-m-d H:i",$list[$i]['uptime']);
		}
		$this->assign('other',$list);
		$this->assign('page',$show);//赋值分页输出
		$this->display();
	}
	private function index_new(){
		$file=M('file');
		$list1=$file->order('uptime desc')->select();
		$list2=$file->order('istop desc')->select();
		$this->assign('list1',$list1);
		$this->assign('list2',$list2);
	}
	private function index_xjgl(){
		$file=M('file');
		$cond['type']='学籍管理';
		$list=$file->where($cond)->select();
		$this->assign('list3',$list);
	}
	private function index_ksgl(){
		$file=M('file');
		$cond['type']='考试及成绩管理';
		$list=$file->where($cond)->select();
		$this->assign('list4',$list);
	}
	private function index_qt(){
		$file=M('file');
		$cond['type']='其他';
		$list=$file->where($cond)->select();
		$this->assign('list5',$list);
	}

}